package com.zhaofei.myapplication.Adapter;

import android.view.View;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.zhaofei.myapplication.Bean.Bean_More;
import com.zhaofei.myapplication.R;

import java.util.List;

/**
 * 版权：易金卡沃 版权所有
 * <p>
 * 作者：zhaofei
 * <p>
 * 创建日期：2018/6/8
 * <p>
 * 描述：
 * <p>
 * 修订历史：
 */
public class Adapter_More extends BaseMultiItemQuickAdapter<Bean_More, BaseViewHolder> {
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public Adapter_More(List<Bean_More> data) {
        super(data);
        addItemType(0, R.layout.item2_m);
        addItemType(1, R.layout.item3_m);
    }

    @Override
    protected void convert(final BaseViewHolder helper, Bean_More item) {
        switch (item.getItemType()) {
            case 0:
//                helper.itemView.setOnClickListener(new View.OnClickListener() {
//                    @Override
//                    public void onClick(View v) {
//                        int pos = helper.getAdapterPosition();
//                        if (lv0.isExpanded()) {
//                            collapse();
//                        } else {
//                            expand(pos);
//                        }
//                    }});


                helper.setText(R.id.id_item_m, item.getName());
                break;
            case 1:
                helper.setText(R.id.id_item_name,item.getName());
                break;
        }
    }
}
